import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import BooksView from "@/views/BooksView.vue";
import CommonView from "@/views/CommonView.vue";
import MyBooksView from "@/views/MyBooksView.vue";
import UsersView from "@/views/UsersView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: LoginView
  },
  {
    path: '/books',
    name: 'Books',
    component: CommonView,
    children: [{path:'',component:BooksView}]
  },
  {
    path: '/mybooks',
    name: 'mybooks',
    component: CommonView,
    children: [{path:'',component:MyBooksView}]
  },
  {
    path: '/users',
    name: 'users',
    component: CommonView,
    children: [{path:'',component:UsersView}]
  }
]

const router = new VueRouter({
  routes
})

export default router
